//
//  WRYSeeBigPicctureViewController.m
//  BaiSiBuJie
//
//  Created by wry on 16/5/7.
//  Copyright © 2016年 WRY. All rights reserved.
//

#import "WRYSeeBigPicctureViewController.h"
#import <Photos/Photos.h>
#import <UIImageView+WebCache.h>
@interface WRYSeeBigPicctureViewController ()
@property (weak, nonatomic) IBOutlet UIScrollView *scrollV;

@property (weak, nonatomic)UIImage *img;
@property (weak, nonatomic)UIImageView *imageView;
@end

@implementation WRYSeeBigPicctureViewController
/*
 PHPhotoLibrary:相簿
 PHAssetCollection: 相册
 PHAsset：照片
 PHAssetCreationRequest： 把照片添加到相簿中
 PHAssetCollectionChangeRequest: 创建，删除，修改相册

 photos用法:每次操作相册或者照片，都要发送一次请求
 
 

 把一张图片保存到自己相册，一般这个图片肯定会先存放到系统相册，在从系统的相册中拷贝一份到自己相册
 如何把一个照片添加到自定义相册中
 1. 把图片转换成PHAssetCreationRequest
 2.  自定义相册
 3. 调用自定义相册add,把PHAssetCreationRequest添加到相册

 */
- (IBAction)dismissBtn:(UIButton *)sender {
    [self dismissViewControllerAnimated:YES completion:nil];


}


#pragma mark - 点击保存
- (IBAction)save:(UIButton *)sender {

    // 判断下当前app是否允许访问相册
    PHAuthorizationStatus status=[PHPhotoLibrary authorizationStatus];


    if(status==PHAuthorizationStatusAuthorized){//允许访问

        //保存
       
        //保存成功

    } else if (status==PHAuthorizationStatusNotDetermined ) {//还没有设置授权,通知用户是否允许访问相册
        //请授权访问相册




    }else {//不允许访问
        //保存失败

        
    }

    // 获取app访问相册状态

    // 检查有没有相册

    //没有就创建相册,保存图片

    //有就直接保存相片



}







@end
